package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.GiftCertificate;
import com.weipai.springboot.module.dao.GiftCertificateDao;
import com.weipai.springboot.module.mapper.GiftCertificateMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: 曹朋飞
 * @Date: 2018/09/13 20:12
 */
@Repository
public class GiftCertificateDaoImpl implements GiftCertificateDao{

    @Autowired
    private GiftCertificateMapper giftCertificateMapper;
    
    @Override
    public int insert(GiftCertificate giftCertificate) {
        return giftCertificateMapper.insert(giftCertificate);
    }

    @Override
    public GiftCertificate getGiftCertificateById(String id) {
        return giftCertificateMapper.getGiftCertificateById(id);
    }

    @Override
    public int updateDel(String id) {
        return giftCertificateMapper.updateDel(id);
    }

    @Override
    public int updateStatus(String id, Integer status) {
        return giftCertificateMapper.updateStatus(id, status);
    }

    @Override
    public int updateByPrimaryKey(GiftCertificate giftCertificate) {
        return giftCertificateMapper.updateByPrimaryKeySelective(giftCertificate);
    }

    @Override
    public List<Map<String, Object>> selectAllByPage(Integer start, Integer size) {
        return giftCertificateMapper.selectAllByPage(start, size);
    }

    @Override
    public Integer selectAllByPageAmount() {
        return giftCertificateMapper.selectAllByPageAmount();
    }

    @Override
    public int batchDeleteById(String[] id) {
        return giftCertificateMapper.batchDeleteById(id);
    }

    @Override
    public List<GiftCertificate> getAll() {
        return giftCertificateMapper.getAll();
    }
}
